package hhh.com.dianming;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity implements View.OnClickListener {
    private Button bt_add,bt_find,bt_id;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        bt_add = findViewById(R.id.bt_add);
        bt_find = findViewById(R.id.bt_find);
        bt_id = findViewById(R.id.bt_id);

        bt_add.setOnClickListener(this);
        bt_find.setOnClickListener(this);
        bt_id.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            /*
            点击添加按钮跳转添加页
             */
            case R.id.bt_add:
                Intent intent = new Intent(this,add.class);
                startActivity(intent);
                break;

            /*
            点击查找按钮进入查找页
             */
            case R.id.bt_find:
                Intent intent1 = new Intent(this,find.class);
                startActivity(intent1);
                break;

            case R.id.bt_id:
                Intent intent2 = new Intent(this,id.class);
                startActivity(intent2);
                break;
        }
    }
}